package com.example.a2205_fx.util.anno;

import com.blankj.utilcode.util.SPUtils;
import com.blankj.utilcode.util.ToastUtils;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

import retrofit2.http.POST;

@Aspect
public class CheckLoginAspect {
    @Pointcut("execution(@com.example.a2205_fx.util.anno.CheckLogin * *(..))")
    public void check(){}
    @Around("check()")
    public void aroundCheck(ProceedingJoinPoint point) throws Throwable {
        if(SPUtils.getInstance().getString("token").isEmpty()){
            ToastUtils.showLong("还未登录，去登录");
        }else {
            point.proceed();
        }
    }
}
